<!--
    group: 企业管理
    name: 添加企业---设立企业
    url: /enterprise/establishEnterprise
-->
<template>
  <div>
    <!--  主体部分  -->
    <div v-if="pageStatus" class="main_content">
      <h5 v-if="nodeType != (7 || 8)">如果您需要添加多个企业，请选择
        <!--<a-button class="success">批量上传</a-button>或-->
        <a-button class="danger" @click="releaseLink">发布链接</a-button>邀请用户自行填写信息
      </h5>
      <a-form-model :model="form" ref="ruleForm" :labelCol="labelCol"  :wrapper-col="wrapperCol" :rules="rules">
        <h3>企业服务模式</h3>

        <PCard class="esm-item" :isCardBorder="true" :shadow="'never'" :isHeadBottomBorder="false" :bodyStyle="{ width: '100%' }">
          <div slot="header" class="card-title">
            <span>{{ EnterpriseServiceModelConfig.formTitle }}</span>
            <a-button type="link" @click="selectServiceModelEvent">重选服务模式</a-button>
          </div>
          <div class="esm-item-body">
            <!-- {{itenIndex}} -->
            <PageForm :formConfig="EnterpriseServiceModelConfig.formConfig" :itemList="EnterpriseServiceModelConfig.data">
              <template v-slot:rateType="itemData">
                <div class="qyfwms-con" style="width: 100%;">
                  {{ { 1: '固定费率', 2: '阶梯费率', 3: '累进阶梯' }[itemData.value] }}
                </div>
              </template>
              <template v-slot:servicerateList="itemData">
                <div class="qyfwms-con" style="width: 100%;">
                  <FWFL :dataList="itemData"></FWFL>
                </div>
              </template>
            </PageForm>
          </div>
        </PCard>


        <a-divider />
        <h3>企业负责人信息</h3>
        <a-descriptions>
          <a-descriptions-item :span="4">
            <a-form-model-item prop="legalPhone" label="法人实名手机号">
              <a-input v-model="form.legalPhone" :disabled="(nodeType==8 || nodeType==6) ? true : false" placeholder="请输入手机号码" />
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="24">
            <a-form-model-item prop="idCardInfo" label="身份证" required :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
              <!-- <UpLoadFile ref="qyfzrxx_sfz" :config="sfzConfig" v-model="form.idCardInfo"
                :fileChangeEvent="(type, fileData) => { fileChangeEvent(type, fileData) }"></UpLoadFile> -->
              <p-UpLoadFile ref="qyfzrxx_sfz" :showHelp="true" :config="sfzConfig" v-model="form.idCardInfo" :customRequestEvent="PUpLoadFileCustomRequestEvent"></p-UpLoadFile>

              <div style="white-space: nowrap">上传身份证证件照：请上传法人有效身份证信息。支持jpg,png,jpeg格式大小不超过5M</div>
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="2">
            <a-form-model-item label="姓名">
              <a-input v-model="form.legalInfo.legalName" />
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="2">
            <a-form-model-item label="身份证号">
              <a-input v-model="form.legalInfo.cardNumber" />
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="2">
            <a-form-model-item label="身份证地址">
              <a-input v-model="form.legalInfo.cardAddress" />
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="2">
            <a-form-model-item label="有效期">
              <a-input v-model="form.legalInfo.cardTerm" />
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="2">
            <a-form-model-item label="政治面貌" prop="politicsStatus">
              <j-dict-select-tag v-model="form.politicsStatus" :disabled="nodeType==8 ? true : false" placeholder="请选择政治面貌" dictCode="face" />
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="2">
            <a-form-model-item label="文化程度" prop="standardCulture">
              <j-dict-select-tag v-model="form.standardCulture" :disabled="nodeType==8 ? true : false" placeholder="请选择文化程度" dictCode="education" />
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="2">
            <a-form-model-item prop="email" label="电子邮箱">
              <a-input v-model="form.email" :disabled="nodeType==8 ? true : false" placeholder="请输入电子邮箱" />
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="3">
            <a-form-model-item label="年龄">
              <a-input v-model="form.legalInfo.age" disabled />
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="4">
            <a-form-model-item prop="businessPhone" label="工商注册手机号">
              <a-input v-model="form.businessPhone" :disabled="nodeType==8 ? true : false" @input='inputEvent' placeholder="请输入工商注册手机号" />
            </a-form-model-item>
          </a-descriptions-item>
        </a-descriptions>

        <a-divider />
        <h3>企业信息</h3>
        <div style="padding: 0 30px;" >
          <a-descriptions>
            <a-descriptions-item :span="4">
              <a-form-model-item prop="registerMoney" label="注册资金">
                <a-input-number v-model="form.registerMoney" :disabled="nodeType==8 ? true : false" step="2" :min="1" :max="200" :precision="0" :formatter="limitNumber"
                  :parser="limitNumber" />万元
              </a-form-model-item>
            </a-descriptions-item>
            <a-descriptions-item :span="4"></a-descriptions-item>
            <a-descriptions-item :span="4">
              <a-form-model-item>
                <span slot="label" style="font-weight: bolder">经营范围</span>
              </a-form-model-item>
            </a-descriptions-item>
            <a-descriptions-item :span="5">
              <div style="display: flex;">
                <div style="width: 19%;"></div>
                <JYFWNew ref="child" :masterDataSource="masterDataSource" :optionList='newTreeData' :defaultValue="newTreeDatadefaultModel" :getDataEvent="getDataEvent_" v-model="newTreeDataModel" />
              </div>
            </a-descriptions-item>
            <a-descriptions-item :span="4">
              <a-form-model-item label=" " :colon="false">
                <span class="addRange" @click="addNatureBusiness">
                  <a-icon type="plus" />添加经营范围
                </span>
              </a-form-model-item>
            </a-descriptions-item>

            <a-descriptions-item  class='descriptionss' :span="12" v-for="i in entNameList">
              <a-form-model-item :label="i===1?'企业名称':' '" :colon="i==1">
                <div class="entNames">
                  <a-form-model-item :prop="'entName'+i+'Short'">
                    <a-input type="input" v-model="form['entName'+i+'Short']" :placeholder="'请输入企业名称'+i" >
                      <span v-if='i!=1' slot='addonBefore'><span v-if='form.areaPre !="请选择园区"'>{{{'0':'荆州市沙市区','1':'沙市区'}[form.areaPre]}}</span><span v-else style='color: #cc0000;'>未选择</span></span>
                      <a-select v-else slot="addonBefore" v-model="form.areaPre" style="width: 130px" @change="onChangeLabel">
                        <a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value">
                          {{ item.label }}
                        </a-select-option>
                      </a-select>
                      <span slot="addonAfter">
                        <a-select v-model="form['labelOrgnameId'+i]" style="width: 130px">
                          <a-select-option v-for="(item, key) in form.business[0].labelOrgname" :key="key" :value="item.id">{{ item.value }}</a-select-option>
                        </a-select>
                        {{{0:'工作室',1:'部',2:'中心'}[form.organizationForm] || ''}}
                      </span>
                    </a-input>
                  </a-form-model-item>
                </div>
              </a-form-model-item>
            </a-descriptions-item>
            <a-descriptions-item :span="4">
              <a-form-model-item label=" " :colon="false">
                <a-button type="primary" @click="autoGenerate">自动生成</a-button>
              </a-form-model-item>
            </a-descriptions-item>

            <a-descriptions-item label="" :span="4">
              <div style="padding: 0 30px 0 19%;">
                <a-alert message="为避免企业重名或不合规导致注册失败，请提供5个备选企业名称，自动生成的企业名称仅供参考，具体能否通过工商系统核名以实际办理结果为准。" type="info" show-icon />
              </div>
            </a-descriptions-item>
          </a-descriptions>



          <!-- <a-divider /> -->
        <h3 style="margin-top: 20px;">经营者关联信息查询</h3>
        <div style="padding: 0 30px 0 23%;">
          <QueryOperatorRelatedInformation v-model="qoriConfig.list" :defaultValue="qoriConfig.defaultList" :disabled="qoriConfig.disabled" :model="qoriConfig.model" :DisplayWizard="true"></QueryOperatorRelatedInformation>
        </div>
        <!-- <a-divider /> padding: 0 30px 0 15%;-->
        <h3 v-if="form.protocolType=='2'" style="margin-top: 40px;">账户信息</h3>
        <div v-if="form.protocolType=='2'" style="padding: 0 30px 0 19%;">
          <CorporateAccountInformation v-model="caiConfig.value" :disabled="caiConfig.disabled" :model="caiConfig.model" :legalInfo="{legalName:form.legalInfo.legalName,cardNumber:form.legalInfo.cardNumber}"></CorporateAccountInformation>
        </div>



        </div>

        <template v-if="totalPoints">
          <a-divider />
          <h3>身份认证/签约信息</h3>
          <div style="padding: 0 30px;">
            <a-descriptions>
              <!--            <a-descriptions-item label="" :span="4">-->
              <!--              登记注册身份验证APP验证成功截图-->
              <!--              <p-UpLoadFile ref="qyfzrxx_sfrz" v-model="form.appPicDetail" :config="sfrzConfig" :customRequestEvent="PUpLoadFileCustomRequestEvent"/>-->
              <!--            </a-descriptions-item>-->
              <a-descriptions-item label="" :span="4">
               <div style="padding: 0 30px 0 19%;">
                已签署的《委托代征协议》扫描件 <span style="color: #FF6A6A;">（若您没有纸质签署的委托代征协议，可跳过上传步骤，完成电子签约）</span>
                <template v-if="form.agreeElec == 0">
                  <p-UpLoadFile v-model="form.agreeDetail" :config="signConfig" :customRequestEvent="PUpLoadFileCustomRequestEvent"/>
                </template>
                <div v-else-if="form.agreeElec == 1">
                  <span style="color: #32BC51;display:inline-block;padding-top: 50px;">
                    <a-icon type="check-circle" theme="filled" />
                    已完成电子签约！
                  </span>
                </div>
               </div>
              </a-descriptions-item>
            </a-descriptions>
          </div>
        </template>



        <a-divider />
        <h3>企业邮寄地址<span class="red" style="font-weight: normal;font-size: 16px;">（用于向您寄送营业执照等相关证件）</span></h3>
        <a-descriptions>
          <a-descriptions-item :span="4">
            <!-- labelCol: { span: 4 }, -->
      <!-- wrapperCol: { span: 20 }, -->
            <a-form-model-item label="收件地址" :labelCol="{ span: 2 ,offset: 4}" :wrapperCol="{span: 16}">
              <a-input v-model="form.mailUserAddress" placeholder="请输入收件地址" />
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="4">
            <a-form-model-item label="收件人" :labelCol="{ span: 2 ,offset: 4}" :wrapperCol="{span: 16}">
              <a-input v-model="form.mailUserName" placeholder="请输入收件人" />
            </a-form-model-item>
          </a-descriptions-item>
          <a-descriptions-item :span="4">
            <a-form-model-item label="手机号" prop="mailUserPhone" :labelCol="{ span: 2 ,offset: 4}" :wrapperCol="{span: 16}">
              <a-input v-model="form.mailUserPhone" placeholder="请输入手机号" />
            </a-form-model-item>
          </a-descriptions-item>
        </a-descriptions>




        <div class="main_footer">
          <a-button v-preventReClick @click="nextStep" :disabled="this.form.protocolType == '2'&& caiConfig.value.isAllEmpty == false && !caiConfig.value.AVRes" type="primary" class="btnsLarge">{{ text }}</a-button>
          <a-button v-preventReClick @click="generatePDF" class="largePreview btnsLine mLeft">预览注册信息</a-button>
        </div>

      </a-form-model>
    </div>

    <!--提交成功提示-->
    <div v-if="!pageStatus" class="main_content">
      <!--      <a-result status="success" title="注册申请已提交，请耐心等待审核" sub-title="您已经完成添加企业申请">-->
      <a-result status="success" title="提交成功，感谢您的配合" sub-title="您已经完成添加企业申请">
        <template #extra>
          <!--          <a-button key="console" type="primary" @click="switchStatus">继续添加</a-button>-->
          <a-button key="buy" @click="toBack">返回</a-button>
        </template>
      </a-result>
    </div>

    <!--发布链接-->
    <a-modal v-model="visible" title=" " :footer="false" @ok="handleOk">
      <p style="font-weight: bolder">请复制链接，发送给用户完成填写！</p>
      <a style="text-decoration: underline;" v-if="urlValue">{{ urlValue }}</a>
      <p style="text-align: center;margin-top: 40px;">
        <a-button type="primary" @click="copyLink">复制链接</a-button>
      </p>
    </a-modal>

    <!--办理提示（银行开户）-->
    <a-modal v-model="isBankShow" title="办理提示" :footer="false" @cancel="handleCancel" :maskClosable="false">
      <p>若您需要为此企业办理银行开户服务，请提前告知我们，谢谢!</p>
      <p>银行开户费用：<span class="red" style="font-weight: bold">{{ serviceMoney }}</span>元</p>

      <p style="text-align: center;margin-top: 40px;">
        <!--bankFlag  是否勾选银行开户 0-否 1-是-->
        <a-button type="primary" @click="accountBank(0)">暂不办理银行开户，下一步</a-button>
        <a-button type="primary" @click="accountBank(1)" class="mLeft gloomy">同意办理银行开户</a-button>
      </p>
    </a-modal>

    <!--选择开户行（银行开户）-->
    <a-modal v-model="isDepositShow" title=" " :footer="false" width="90%" :maskClosable="false">
      <BankAccount ref="bankAccount" :isOutside="false"/>
      <p style="text-align: center;margin-top: 40px;">
        <a-button type="primary" @click="referTo" class="btnsLarge">提交</a-button>
      </p>
    </a-modal>

    <!--提示经营范围有误-->
    <a-modal
      v-model="businessInfo.visible"
      :footer="null" :closable="false"
      :keyboard="false"
      :maskClosable="false"
    >
      <div class="exceedLimit">
        <h4>
          <a-icon type="exclamation-circle" theme="filled" />
          {{ businessInfo.message }}
        </h4>
        <div class="desc_btn">
          <a-button type="primary" @click="backEdit">返回修改</a-button>
        </div>
      </div>
    </a-modal>

    <!--提示身份证与上次上传不一致-->
    <a-modal v-model="isCardShow" title=" " :footer="false" :maskClosable="false"
             @cancel="SureVerifyIDCard">
      <div>
        <a-icon type="close-circle" theme="filled" style="color:#ff4d4f;font-size: 20px;" />
        对不起，您上传的身份证信息与原法人不符，请重新上传！
      </div>
      <p style="text-align: center;margin-top: 40px;">
        <a-button type="primary" @click="SureVerifyIDCard">确认</a-button>
      </p>
    </a-modal>

    <!--企业服务模式选择-->
    <a-modal title="企业服务模式选择" :visible="EnterpriseServiceModelConfig.visible" @ok="hideModalSM" @cancel="handleCancelSM"
      :confirm-loading="EnterpriseServiceModelConfig.loading" :width="1000">
      <EnterpriseServiceModel :serviceConfId="EnterpriseServiceModelConfig.serviceConfId" :radioChange="radioChange"></EnterpriseServiceModel>
    </a-modal>

    <!-- 企业注册信息预览 -->
    <EnterprisePreview :config="enterprisePreview" :newForm="newForm" :newTreeDataModel="newTreeDataModel" @closeFileModal="closeFileModal" />

  </div>
</template>

<script>
import QueryOperatorRelatedInformation from './components/QueryOperatorRelatedInformation.vue'
import CorporateAccountInformation from './components/CorporateAccountInformation.vue'
import { getVerifyOcrIDCard } from '@api/api'
import {
  getManageNature, getLegalRegist, getRegistMsg, queryEntNames,
  getEntInfo, getEntDetailInfo, getInfoSubVerify, queryLoginChannel,
  queryServicePrice
} from '@/api/enterprise'
import {
  conversionManyBranch,cloneObject,limitDigits,copyLinkContent,
  conversionElement, conversionManyElement,verificationIDCardInfo,
  getIdCardInfo,judgeNull,filterNull,filterNullArr,
  idCardDateAvailability,Storage
} from '@/utils/util'
import * as Util from '@/utils/util'
import LocalforageHelp from '@/utils/LocalforageHelp'
const lfh = LocalforageHelp()
import JYFWProEvent from './../common/utils/JYFWPro'
import JYFWNew from './../common/JYFWPro'
import FWFL from './EnterpriseServiceModel/FWFL.vue'
import JDictSelectTag from '@/components/dict/JDictSelectTag.vue'
import BankAccount from './serviceEnterprise/BankAccount'
import EnterpriseServiceModel from './EnterpriseServiceModel/index.vue'
import EnterprisePreview from '@/views/enterprise/modules/enterprisePreview.vue'

const getUploadConfig = ()=>{
  const temp = {
    dir: "/qsb/idCard/",
      // 证  all  ；  单文件 对应 card1 ；   多文件 对应  card3 ； 身份证  对应  card1（身份证正面）、card2（身份证反面）
    model: "身份证",
    // 此参数选填   此属性只在 model= 身份证 时 启用   默认值文false
    showBG: true,
    // 此参数选填  表示是否可编辑
    readonly: false,
    // 提示信息
    tips:{
      card1: '请上传身份证正面',
      card2: '请上传身份证反面',
    },
    // 此参数选填   文件上传必填校验 默认为false 不校验   当值为true时进行强制校验  需要配合【getDataCheckRes】方法使用；
    // 方法【getDataCheckRes】的具体用法如: this.$refs.UpLoadFile.getDataCheckRes({ card1: "请上传身份证正面",card2: "请上传身份证反面", card3: "请上传附件"});
    // 其中 【getDataCheckRes】的参数辨识检验不通过时对应的提示信息；card1、card2、card3均可缺省，也可选填对应的字段    此参数可空
    required: true,
    // 此参数选填   要回显的数据 card1 card2 的值的格式为：{name:'',url:''} ;  card3 的值的格式为 [{name:'',url:''}，{name:'',url:''}]
    defaultFileList: {
      card1: {}, // {name:'',url:''}
      card2: {},// {name:'',url:''}
    },
    // 此参数集必填
    fielConfig: {
      // 允许上传的文件类型 当为空时表示不限制  默认为空
      //    可供选择类型：
      //          图片('jpg', 'png', 'jpeg')
      //          文档('xlsx', 'xls', 'pptx', 'ppt', 'pdf', 'doc', 'docx', 'txt')
      //          压缩包('zip', 'rar')  发票('pdf', 'jpg', 'png', 'jpeg', 'doc', 'docx', 'zip', 'rar')
      //          PDF(pdf)
      //          委托代征协议('pdf','jpg', 'png', 'jpeg')
      //          我的任务('jpg', 'png', 'jpeg','pdf','xlsx', 'xls', 'pdf', 'doc', 'docx','zip', 'rar' )
      // eg:
      //    当值为string类型时，对所有（card1,card2,card3）的有效；
      //    当值为对象（{"card1":'图片',"card2":'文档', "card3":'PDF'}）时，可指定每个（card1/card2/card3）所对应的类型
      type: "图片",
      // 允许上传的文件个数  默认值为1
      // eg: 1 表示只允许上传1个文件；
      //      当值为对象（{"card1":1,"card2":2, "card3":3}）时，可指定每个（card1/card2/card3）所对应的类型
      size: 1,
      // 上传的单个文件大小 单位为 MB  默认值为1
      //  eg: 当值为 number 时，对所有（card1,card2,card3）的有效；
              // 当值为对象（{"pdf":5,"xlsx":10, "zip":100}）时,可指定对应的文件类型的大小（单位：MB）
      singleFileSize: 5,
    },
  }
  return temp
}
const getSfrzConfig = ()=>{
  const temp = {...getUploadConfig()}
  temp.dir = '/qsb/contract/'
  temp.model = '单文件'
  temp.showBG = false
  temp.tips = { card1: '请上传登记注册身份验证APP验证成功截图',}
  temp.defaultFileList = { card1: {} } // {name:'',url:''}
  return temp
}
const getSignConfig = ()=>{
  const temp = {...getUploadConfig()}
  temp.dir = '/qsb/contract/'
  temp.model = '单文件'
  temp.fielConfig.type = '委托代征协议' // 委托代征协议   PDF
  temp.fielConfig.singleFileSize = 10
  temp.showBG = false
  temp.tips = { card1: '请上传已签署的《委托代征协议》扫描件',}
  temp.defaultFileList = { card1: {} } // {name:'',url:''}
  return temp
}
const pageFormConfig = {
  columnCount: 3,
  layout: 'horizontal',
  labelAlign: 'left',
  labelCol: { span: 12 },
  wrapperCol: { span: 11 },
  rowAttr: {
    // type:'',
    // justify:'',
    // gutter:'',
    // align:'',
  },
  celAttr: {
    // flex:'',
    // offset:'',
    // order:'',
    // pull:'',
    // push:'',
    span: 8,
    // xxl:{},
  }
}
const formItemAttr2 = {
  labelCol: { span: 8 }, wrapperCol: { span: 12 }
}
const formItemAttr21 = {
  labelCol: { span: 10 }, wrapperCol: { span: 12 }
}
const formItemAttr1 = {
  labelCol: { span: 3 }, wrapperCol: { span: 20 }
}

export default {
  name: 'establishEnterprise',
  components: {
    JDictSelectTag,
    BankAccount,
    JYFWNew,
    FWFL,
    EnterpriseServiceModel,
    EnterprisePreview,
    QueryOperatorRelatedInformation,
    CorporateAccountInformation
  },
  data() {
    return {
      // 账户信息
      caiConfig:{
        value:{}, // {'userName2':'ssss','userName3':'dddd'},
        disabled:false, // edit 状态下可用
        model:'edit', // view 表示预览模式  edit  表示可编辑模式 默认值
        // legalInfo:{} // 法人信息 {name:'', phone:'', cardNum:''}
      },
      // 经营者关联信息查询
      qoriConfig:{
        list:{},
        disabled:false, // edit 状态下可用
        model:'edit', // view 表示预览模式  edit  表示可编辑模式 默认值
        // 经营者关联信息查询  编辑回显值
        defaultList: {}, //{'userName2':{url:'https://zxcloud-test.oss-cn-hangzhou.aliyuncs.com/user/license/1688540243642_%E5%8A%9E%E5%85%AC.png',name:''},'userName3':{url:'https://zxcloud-test.oss-cn-hangzhou.aliyuncs.com/user/license/1688540248058_%E5%8C%97%E4%BA%AC2.png',name:''}},
      },
      bizId: null,
      labelCol: { span: 4 },
      wrapperCol: { span: 20 },
      form: {
        idCardInfo: {},
        entServiceModel: 1,
        registerMoney: 1,
        protocolType:1, // 企业所属合作模式  1 渠道总  2 非渠道总
        areaPre:'请选择园区',
        legalInfo: {
          legalName: '',
          cardNumber: '',
          cardAddress: '',
          cardTerm: '',
        },  //法人信息
        legalPhone: '',  //法人实名手机号
        businessPhone: '', //工商注册手机号
        agreeList: [],    //委托代征协议扫描件
        agreeDetail: {},    //委托代征协议扫描件
        appPicList: [],   //APP验证成功截图
        appPicDetail: {},   //APP验证成功截图
        organizationForm: '',
        entNamesList:[],
        standardCulture: '',
        politicsStatus: '',
        email: '',
        mailUserAddress:'',
        mailUserName:'',
        mailUserPhone:'',
        entName1Short: '',
        entName2Short: '',
        entName3Short: '',
        entName4Short: '',
        entName5Short: '',
        labelOrgnameId1:'',
        labelOrgnameId2:'',
        labelOrgnameId3:'',
        labelOrgnameId4:'',
        labelOrgnameId5:'',
        business: [{
          manageId: [],
          nodeNature: '',
          invoiceName: '',
          labelEntname: '',   //地区
          labelOrgname: '',   //行业后缀
        }],
        agreeElec: 0,  //电子签是否完成 0-否 1-是
        agreeType: null,  //合同类型 0-无 1：电子版；2:纸质版
        serviceConfId: null,
        registerType: null,
      },
      rules: {
        standardCulture: [{ required: true, message: '请选择文化程度', trigger: 'change' }],
        politicsStatus: [{ required: true, message: '请选择政治面貌', trigger: 'change' }],
        email: [
          { required: false, message: '请输入电子邮箱', trigger: 'blur' },
          { validator: this.validateEmail }
        ],
        organizationForm: [{ required: true, message: '请选择组织形式', trigger: 'change' }],
        registerMoney: [{ required: true, message: '请输入注册资金', trigger: 'blur' }],
        mailUserPhone:[
          { required: false, message: '请输入邮寄手机号', trigger: 'blur' },
          { validator: this.validatePhone }
        ],
        legalPhone: [
          { required: true, message: '请输入法人实名手机号', trigger: 'blur' },
          { validator: this.validatePhone }
        ],
        // 身份证校验
        idCardInfo: [
          { required: true, message: '请上传法人身份证的正反面', trigger: 'blur', },
          { validator: this.validateIdCardInfo }
        ],
        businessPhone: [
          { required: true, message: '请输入工商注册手机号', trigger: 'blur' },
          { validator: this.validatePhone1 }
        ],
        manageId0: [
          { required: true, validator: (...args) => { return this.validateManageId(...args, 0) }, trigger: 'change' },
          // { required: true, message: '请选经营类别', trigger: 'change' },
        ],
        manageId1: [
          { required: true, validator: (...args) => { return this.validateManageId(...args, 1) }, trigger: 'change' },
          // { required: true, message: '请选经营类别', trigger: 'change' },
        ],
        entName1Short: [
          { required: true, message: '请输入企业名称'},
          { min: 1, max: 60, message: '企业名称字数限制在1到60个字之间'},
          { validator: this.validateEnterprise }
        ],
        entName2Short: [
          { required: true, message: '请输入企业名称'},
          { min: 1, max: 60, message: '企业名称字数限制在1到60个字之间'},
          { validator: this.validateEnterprise }
        ],
        entName3Short: [
          { required: true, message: '请输入企业名称' },
          { min: 1, max: 60, message: '企业名称字数限制在1到60个字之间'},
          { validator: this.validateEnterprise }
        ],
        entName4Short: [
          { required: true, message: '请输入企业名称'},
          { min: 1, max: 60, message: '企业名称字数限制在1到60个字之间' },
          { validator: this.validateEnterprise }
        ],
        entName5Short: [
          { required: true, message: '请输入企业名称' },
          { min: 1, max: 60, message: '企业名称字数限制在1到60个字之间' },
          { validator: this.validateEnterprise }
        ],
      },
      pageStatus: true, //切换提交和完成状态

      //--------经营范围选择  start ↓---------
      treeData: [],  //经营类别
      treeData_:{},
      fieldOptions: {
        label: 'nodeName',
        value: 'id',
        children: 'children',
      },
      newTreeData:[],//经营范围
      // 经营范围 主数据源
      masterDataSource:[],
      newTreeDataModel:[],
      newTreeDatadefaultModel:[],

      //上传身份证
      objSfz: {   //身份证
        shenfenz: null,
        shenfenf: null,
      },
      sfzConfig:getUploadConfig(),
      sfzConfig1: {
        readonly: false,  // 用于标记是否是可编辑的 此参数可选   默认值 false 表示可编辑   true 表示只读，不可编辑
        dir: '/qsb/idCard/', // 上传文件的地址
        required: true, // 文件上传必填校验 默认为false 不校验   当值为true时进行强制校验
        // multiple: false, // 优先级高于isTwo  开启多文件上传  默认值为false   当值为true时表示开启对文件上传，同时 isTwo 和 upLoadCardListConfig 失效
        // isTwo: true, // 是否开启两个卡片上传 默认为false  表示只启用单个卡片单文件上传   true 表示开启两个卡片的单文件上传
        showCardList: ['card1', 'card2'],
        upLoadCardListConfig: [
          { type: '1', tips: '身份证人像面', fileInfo: { name: '', url: '' } },
          { type: '1', tips: '身份证国徽面', fileInfo: { name: '', url: '' } }
        ], // 此项最多可以传两组值 {type:'1',tips:'身份证人像面',backgroundPic:''},
        fielConfig: {
          type: '图片', // 允许上传的文件类型 当为空时表示不限制  默认为空   可供选择类型： 图片  文档  压缩包  发票
          size: 2, // 允许上传的文件个数  默认值为1
          singleFileSize: 5, //上传的单个文件大小 单位为 MB  默认值为1
        }
      },

      //身份验证APP验证成功截图
      sfrzConfig:getSfrzConfig(),
      sfrzConfig1: {
        readonly: false,  // 用于标记是否是可编辑的 此参数可选   默认值 false 表示可编辑   true 表示只读，不可编辑
        dir: '/qsb/contract/', // 上传文件的地址
        required: false, // 文件上传必填校验 默认为false 不校验   当值为true时进行强制校验
        // multiple: false, // 优先级高于isTwo  开启多文件上传  默认值为false   当值为true时表示开启对文件上传，同时 isTwo 和 upLoadCardListConfig 失效
        // isTwo: false, // 是否开启两个卡片上传 默认为false  表示只启用单个卡片单文件上传   true 表示开启两个卡片的单文件上传
        showCardList: ['card1'],
        upLoadCardListConfig: [
          { type: '1', tips: '  ', fileInfo: { name: '', url: '' } },
        ], // 此项最多可以传两组值 {type:'1',tips:'身份证人像面',backgroundPic:''},
        fielConfig: {
          type: '图片', // 允许上传的文件类型 当为空时表示不限制  默认为空   可供选择类型： 图片  文档  压缩包  发票
          size: 1, // 允许上传的文件个数  默认值为1
          singleFileSize: 5, //上传的单个文件大小 单位为 MB  默认值为1
        }
      },

      //委托代征协议扫描件
      totalPoints: true,   //“总包”协议用户，不展示企业《委托代征协议》
      signConfig:getSignConfig(),
      signConfig1: {
        readonly: false,  // 用于标记是否是可编辑的 此参数可选   默认值 false 表示可编辑   true 表示只读，不可编辑
        dir: '/qsb/contract/', // 上传文件的地址
        required: false, // 文件上传必填校验 默认为false 不校验   当值为true时进行强制校验
        // multiple: false, // 优先级高于isTwo  开启多文件上传  默认值为false   当值为true时表示开启对文件上传，同时 isTwo 和 upLoadCardListConfig 失效
        // isTwo: false, // 是否开启两个卡片上传 默认为false  表示只启用单个卡片单文件上传   true 表示开启两个卡片的单文件上传
        showCardList: ['card1'],
        upLoadCardListConfig: [
          { type: '1', tips: '   ', fileInfo: { name: '', url: '' } }
        ], // 此项最多可以传两组值 {type:'1',tips:'身份证人像面',backgroundPic:''},
        fielConfig: {
          type: 'PDF', // 允许上传的文件类型 当为空时表示不限制  默认为空   可供选择类型： 图片  文档  PDF  压缩包  发票
          size: 1, // 允许上传的文件个数  默认值为1
          singleFileSize: 10, //上传的单个文件大小 单位为 MB  默认值为1
        }
      },

      //企业名称
      entNameList:[1,2,3,4,5],  //企业名称
      dictOptions:[
        {value:'0',label:'荆州市沙市区'},{value:'1',label:'沙市区'}
      ],

      file: {},
      text: '下一步',
      nodeType: null,  //接受来源
      id: null,   //返回需要id

      //身份证提示
      isCardShow: false,
      businessInfo:{
        visible: false,
        message: '经营范围选择有误！'
      },

      //--------发布链接  start ↓---------
      visible: false, //发布链接
      urlValue: '',
      //--------企业服务模式选择  start ↓---------
      // 企业服务模式
      EnterpriseServiceModelConfig: {
        // 企业类型
        registerType:'',
        // 渠道id
        channelId:'',
        // 服务模式id
        serviceConfId:'',
        unit:' 元',
        // 详情中的数据
        serviceModelVo:{},
        visible:false,
        loading:false,
        formConfig:pageFormConfig,
        formTitle:'',
        data:[
          { enName: 'svModelDesc', cnName: '服务模式说明', type: 'label', value: '---', monoRow: true, formItemAttr: formItemAttr1 },
          { enName: 'svRegistPrice', cnName: '注册服务费', type: 'label', value: '---', formItemAttr: formItemAttr2 },
          { enName: 'svBankPrice', cnName: '开户服务费', type: 'label', value: '---', formItemAttr: formItemAttr2 },
          { enName: 'svTaxPrice', cnName: '税务变更费', type: 'label', value: '---', formItemAttr: formItemAttr2 },
          { enName: 'svYearPrice', cnName: '服务年费', type: 'label', value: '---', formItemAttr: formItemAttr2 },
          { enName: 'svBusinessPrice', cnName: '工商变更费', type: 'label', value: '---', formItemAttr: formItemAttr2 },
          { enName: 'svCanclePrice', cnName: '企业注销费', type: 'label', value: '---', formItemAttr: formItemAttr2 },
          { enName: 'invoiceMin|invoiceMax', cnName: '月开票额度限制', type: 'label', value: '---', formItemAttr: formItemAttr21 },
          { enName: 'rateType', cnName: '服务费模式', type: 'custom', value: '---', formItemAttr: formItemAttr2 },
          { enName: 'servicerateList', cnName: '服务费率', type: 'custom', value: '---', monoRow: true, formItemAttr: formItemAttr1 },
        ]
      },
      //--------银行开户提示层  start ↓---------
      isBankShow: false,  //银行开户提示层
      serviceMoney: 0, //银行开户费用
      isDepositShow: false,  //选择开户行提示层
      //--------企业注册信息预览  start ↓---------
      //企业注册信息预览
      enterprisePreview:{
        visible: false,
      },
      newForm: {},
    };
  },
  mounted() {
    let isEdit = false
    //企业id
    if (this.$route.query.bizId) {
      this.bizId = this.$route.query.bizId;
      this.$nextTick(()=>{
        setTimeout(()=>{
          this.getQueryDetail(this.bizId);
        },500)
      })
    }
    //获取参数
    if (this.$route.query.serviceConfId && this.$route.query.registerType && this.$route.query.protocolType) {
      this.form.serviceConfId = this.$route.query.serviceConfId;  //企业服务模式
      this.form.registerType = this.$route.query.registerType;  //注册类型
      this.EnterpriseServiceModelConfig.registerType = this.$route.query.registerType;
      this.EnterpriseServiceModelConfig.serviceConfId = this.$route.query.serviceConfId;
      this.form.protocolType = this.$route.query.protocolType;  //合作模式    1总包；2分包
      if (this.form.protocolType == 1){
        this.totalPoints = false;
      }else{
        this.totalPoints = true;
      }

      this.getEntgetRegistMsg();   //获取渠道注册短链接
      this.getServiceCharge(this.form.serviceConfId);   //获取服务费
      const data = Storage.get('serviceConfItemInfo')
      this.setFormItem({...data, ...data.servicefeeList && data.servicefeeList[0]})
    }
    //来源nodeType  4-补充信息 5-上传委托代征协议  6-提交审核  7-修改资料  8-修改核名企业
    if (this.$route.query.nodeType) {
      this.caiConfig.disabled = false
      this.qoriConfig.disabled = false
      this.nodeType = this.$route.query.nodeType;
      if (this.$route.query.nodeType == 5) {
        //上传委托代征协议  跳到指定位置
        this.$nextTick(() => {
          this.toLocal();
        });
      }else if (this.$route.query.nodeType == 6) {
        //提交审核操作支持修改身份证信息 11.22
        // this.sfzConfig.readonly = true;
        // this.sfrzConfig.readonly = true;
        this.text = '提交审核'
      }else if (this.$route.query.nodeType == 7){
        //修改资料 链接不展示
        // 纸质  可更改所有   电子 手机号与身份证需校验
        // this.sfzConfig.readonly = true;
      }else if (this.$route.query.nodeType == 8){
        //修改核名企业   除企业名称,经营范围外其他都不可编辑
        this.sfzConfig.readonly = true;
        // this.sfrzConfig.readonly = true;
        this.signConfig.readonly = true;
        isEdit = true
        this.caiConfig.disabled = true
        this.qoriConfig.disabled = true
      }
    }
    // this.getBusinessScope(isEdit);  //获取经营范围
    this.initEvnet() // 获取经营范围

  },
  watch: {
  'form.idCardInfo': {
    handler(val) {
      let params = {};
      params.cardFrontUrl = val.card1.url;
      params.cardBackUrl = val.card2.url;
      if (params.cardFrontUrl && params.cardBackUrl) {
        this.getBusinessLicenseOcrFun(params);
      }
    },
    deep: true
  },
  //监听经营范围
  newTreeDataModel: {
    handler(val) {
      if(val && val.length>0){
        const firstItem = val[0]
        this.form.business[0].nodeNature = firstItem.nodeNature;
        this.form.business[0].invoiceName = firstItem.invoiceName;
        this.form.business[0].labelEntname = firstItem.labelEntname;
        this.form.business[0].labelOrgname = firstItem.labelOrgnameList;
        this.form.organizationForm = firstItem.organizationForm;
        if(firstItem.labelOrgnameList){
          for(var i = 1; i < 6; i++){
            // if(this.form['labelOrgnameId'+i].length<=0){
            //   this.form['labelOrgnameId'+i] = firstItem.labelOrgname[0].id;
            // }
            this.form['labelOrgnameId'+i] = firstItem.labelOrgnameList[0].id;
          }
        }


        // console.log('监听经营范围================',val,firstItem,this.businessScope);

        // let tempArr = [];
        // val.forEach((item) => {
        //   const { ids, nodeName, nodeNature, invoiceName } = item
        //   //字符串转数组格式
        //   // tempArr.push(ids.map(Number))
        //   tempArr.push(ids.map(Number))
        // })
        this.form.manageId = val.map(item=>item.jyfw);
      }

    },
    deep: true,
    immediate: true,
  },
},
  methods: {
    //上传身份证识别ocr
    fileChangeEvent(type, files) {
      // console.log('fileChangeEvent===>',type,files);
      this.fileObjf = files;
      if (type == 'card1') {
        this.objSfz.shenfenz = files.url
      } else if (type == 'card2') {
        this.objSfz.shenfenf = files.url
      }
    },
    //身份证ocr识别
    getBusinessLicenseOcrFun(params) {
      getVerifyOcrIDCard(params).then(res => {
        if(res.success){
          let legalInfo = this.form.legalInfo;
          if(legalInfo && (legalInfo.legalName == res.result.realName && legalInfo.cardNumber == res.result.idcardNum)){
            const validateArr = res.result.validate.split('-')
            const resValidate = idCardDateAvailability(validateArr[1].replaceAll('.','-'))
            if(!resValidate){
              this.$warning({
                title: '办理提示',
                content: '当前身份证已过期，影响之后的业务办理，系统拒绝当前操作！请更换新的身份证！！',
              });
              return false;
            }
            //判断身份证地址及年龄相关限制
            let val = verificationIDCardInfo(this,res.result.idcardNum,res.result.address);

            for (let a = 0; a < val.length; a++) {
              if (val[a]){
                this.$warning({
                  title: '办理提示',
                  content: val[a],
                });
              }
            }
          }else{
            //判断审核拒绝并且为电子签    1：电子版；2:纸质版
            if (this.nodeType == 7 && this.form.agreeType == 1){
              this.isCardShow = true;
              return false;
            }
          }
        }else{
          this.$warning({
            title: '办理提示--失败',
            content: `失败原因：${res.message} ；请检查上传的身份证图片是否正确！`,
          });
        }
        return res;
      }).then(res => {
        if (res.success) {
          let age = getIdCardInfo(res.result.idcardNum,3);   //根据身份证号获取年龄
          this.form.legalInfo = {
            cardAddress: res.result.address,
            cardBackUrl: this.form.idCardInfo.card2.url,
            cardFrontUrl: this.form.idCardInfo.card1.url,
            cardBirth: res.result.birthday,
            cardNation: res.result.race,
            cardPolice: res.result.issuedBy,
            cardSex: res.result.cardSex,
            cardTerm: res.result.validate,
            cardNumber: res.result.idcardNum,
            legalName: res.result.realName,
            age: age,
          }
        }
      })
    },
    //------------------------- 页面事件  start ↓------------------
    //校验法人手机号是否注册
    verifyMobile(phone) {
      let isPhone = phone;
      getLegalRegist(isPhone).then(res => {
        if (res.success) {
          if (!this.form.businessPhone){
            this.form.businessPhone = this.form.legalPhone;
          }
        } else {
          this.$message.warning(res.message);
        }
      })
    },
    //TODO 工商注册手机号
    inputEvent(e){
      console.log(123,e)
    },
    //自动生成企业名称
    autoGenerate() {
      let params = {};
      params.num = 5;
      // this.$refs.ruleForm.clearValidate();
      queryEntNames(params).then(res => {
        if (res.success) {
          if (res.result && res.result.entNames) {
            let data = res.result.entNames;
            if(!this.entNamesList){
              this.entNamesList = data;
              for(let i = 1; i < 6; i++){
                if(this.form['entName'+i+'Short'].length<=0 || this.nodeType){
                  this.form['entName'+i+'Short'] = data[i-1];
                }
              }
            }
            const temp = {}
            for(var i = 1; i < 6; i++){
              temp['entName'+i+'Short'] = this.containsFun(this.entNamesList, this.form['entName'+i+'Short'])
            }
            this.entNamesList = data;
            for(var i = 1; i < 6; i++){
              if(this.form['entName'+i+'Short'].length<=0 || temp['entName'+i+'Short']){
                this.form['entName'+i+'Short'] = data[i-1];
              }
            }
          }
        } else {
          this.$message.warning(res.message);
        }
      })
    },
    onChangeLabel(e){
      this.form.areaPre = e;
    },
    //继续添加
    switchStatus() {
      // this.pageStatus = true;
      this.$router.push({
        path: '/enterprise/addEnterprise'
      })
    },
    //返回列表
    toBack() {
      this.$router.push({
        path: '/enterprise/enterpriseList/enterpriseDetails',
        query: {
          bizId: this.id
        }
      })
    },
    // 滑动
    toLocal() {
      window.scrollTo(0, document.body.scrollHeight);
    },
    //------------------------- 提交  start ↓------------------
    //下一步
    nextStep() {
      //判断身份证必传   this.$refs['qyfzrxx_sfz'].getData()
      const check_qyfzrxx_sfz = this.$refs['qyfzrxx_sfz'].getDataCheckRes({ card1: "请上传身份证正面",card2: "请上传身份证反面"});
      const child_res= this.$refs.child.getVerificationRes();  //校验经营范围
      this.$refs.ruleForm.validate(valid => {
        if(this.form.areaPre == '' || this.form.areaPre == '请选择园区'){
          this.$message.warning('请检查园区是否选择');
          return false;
        }
        //判断是否要校验文件必传
        let tempvalid = valid
        if (tempvalid && JSON.stringify(check_qyfzrxx_sfz).indexOf(false) >= 0) {
          this.$message.warning('请检查身份证是否上传');
          tempvalid = false;
        }
        if(tempvalid && !child_res){
          this.$message.warning('请检查经营范围是否选择！');
          tempvalid = false;
        }
        // 检查银行卡核验是否成功
        // if(this.form.protocolType == '2'&& this.caiConfig.value.AVRes==false){
        //   this.$message.warning('请先核验账户信息！');
        //   tempvalid = false;
        // }
        if(this.caiConfig.value.isAllEmpty && this.caiConfig.value.isAllEmpty == false && this.caiConfig.value.AVRes && this.caiConfig.value.AVRes == false ){
          this.$message.warning('请先核验账户信息！');
          tempvalid = false;
        }

        if (tempvalid) {
          this.examineFun();
          //处理银行开户弹层是否展示   bankFlag  是否勾选银行开户 0-否 1-是
          // bankFlag 无值  展示银行开户弹层
          // bankFlag 0 直接请求接口
          // bankFlag 1 && openBankInfo  直接请求接口
          // bankFlag 1  openBankInfo 无值  展示银行开户弹层
          // if (this.form.bankFlag == 0 || (this.form.bankFlag == 1 && this.form.openBankInfo)){
          //   this.examineFun();
          // }else{
          //   this.isBankShow = true;
          // }

        } else {
          this.$message.warning('请仔细检查页面数据内容')
          return false;
        }
      });
    },
    //提交
    referTo(){
      const res = this.$refs['bankAccount'].getParam();
      if(!res.isPass){
        return false
      }
      this.form = {...this.form,openBankInfo:res.param}
      this.examineFun();
    },
    //处理提交参数
    getParamData(){
      let params = {};
      // params = this.form;
      let paramsNew = cloneObject(this.form);

      const getFileInfo = (key) =>{
        const temp = this.form[key]
        return {fileName:temp.card1.name,fileUrl:temp.card1.url}
      }

      //委托代征协议-----总包不展示协议上传
      if (this.form.protocolType == 1){

      }else{
        if (this.form.agreeDetail && this.form.agreeDetail.card1){
          if (this.form.agreeDetail.card1.url){
            // params.agreeInfo = {};
            // this.form.agreeList = [
            //   {
            //     fileName: this.form.agreeDetail.card1.name,
            //     fileUrl: this.form.agreeDetail.card1.url
            //   }
            // ];
            // params.agreeInfo.agreeList = this.form.agreeList;
            params.agreeInfo = {agreeList:[getFileInfo('agreeDetail')]};
          }
        }
      }

      // 银行账户信息
      // if(this.form.protocolType == '2'){
      //   // entBankReq:{},
      //   params['entBankReq'] = {...this.caiConfig.value}
      // }

      if(this.caiConfig.value.isAllEmpty == false && this.caiConfig.value.AVRes == true ){
        params['entBankReq'] = {...this.caiConfig.value}
      }
      console.log('this.caiConfig.value 11=====>',params['entBankReq'] );

      // 经营者关联信息查询
      Object.keys(this.qoriConfig.list).forEach(key=>{
        const {fileName, url} = this.qoriConfig.list[key]
        const temp={}
        temp[`${key}List`] = [{fileName, fileUrl:url, fileType:'', valEdate:'',valSdate:''}]
        params[key] = {...temp}
      })


      //APP验证成功截图
      // if (this.form.appPicDetail && this.form.appPicDetail.card1){
      //   if (this.form.appPicDetail.card1.url){
      //     // params.appInfo = {};
      //     // this.form.appPicList = [
      //     //   {
      //     //     fileName: this.form.appPicDetail.card1.name,
      //     //     fileUrl: this.form.appPicDetail.card1.url
      //     //   }
      //     // ];
      //     // params.appInfo.appPicList = this.form.appPicList;
      //     params.appInfo = {appPicList:[getFileInfo('appPicDetail')]};
      //   }
      // }
      //银行开户相关
      // params.bankFlag = this.form.bankFlag;   //是否勾选银行开户 0-否 1-是
      // params.openBankInfo = paramsNew.openBankInfo;   //银行开户相关参数

      params.baseInfo = {};
      // params.baseInfo.serviceConfId = this.form.serviceConfId;  //企业服务模式
      params.baseInfo.registerType = this.form.registerType;  //注册类型:1-个体工商户2-个人独资企业3-有限公司4-合伙企业
      params.baseInfo.protocolType = this.form.protocolType;  // 企业所属合作模式
      //处理数组   经营范围ID
      params.baseInfo.manageId = this.form.manageId;
      // 服务模式id
      params.baseInfo.serviceConfId = this.EnterpriseServiceModelConfig.serviceConfId;
      //处理企业名称
      let name,urban,range;
      //拿取经营范围和园区
      const urbanName = {0:'荆州市沙市区',1:'沙市区'}
      const organizationFormList = {0:'工作室',1:'部',2:'中心'}
      urban = urbanName[this.form.areaPre] || ''
      name = organizationFormList[this.form.organizationForm] || ''

      if (this.form.business[0].labelOrgname){
        let labelOrgnameList = this.recombFun(this.form.business[0].labelOrgname);
        for(var i = 1; i < 6; i++){
          let tempName = ''
          if(this.form['labelOrgnameId'+i] && labelOrgnameList[this.form['labelOrgnameId'+i]]){
            tempName = labelOrgnameList[this.form['labelOrgnameId'+i]].value
          }else{
            tempName = '  '
          }
          params.baseInfo['entName'+i] = urban + this.form['entName'+i+'Short'] + tempName + name;
          // params.baseInfo['entName'+i] = urban + this.form['entName'+i+'Short'] + labelOrgnameList[this.form['labelOrgnameId'+i]].value + name;
          params.baseInfo['entName'+i+'Short'] = this.form['entName'+i+'Short'];
          params.baseInfo['labelOrgnameId'+i] = this.form['labelOrgnameId'+i];
        }
      }
      params.baseInfo.organizationForm = this.form.organizationForm;  //组织形式:0-工作室 1-部 2-中心
      params.baseInfo.registerMoney = conversionManyBranch(paramsNew.registerMoney);   //注册资金,单位分
      params.baseInfo.areaPre = this.form.areaPre;
      params.baseInfo.mailUserAddress = this.form.mailUserAddress;
      params.baseInfo.mailUserName = this.form.mailUserName;
      params.baseInfo.mailUserPhone = this.form.mailUserPhone;
      params.legalInfo = {};
      params.legalInfo = this.form.legalInfo;
      params.legalInfo.legalPhone = this.form.legalPhone;  //法人实名手机号
      params.legalInfo.standardCulture = this.form.standardCulture;  //文化程度
      params.legalInfo.politicsStatus = this.form.politicsStatus;  //政治面貌
      params.legalInfo.email = this.form.email;  //电子邮箱
      params.legalInfo.businessPhone = this.form.businessPhone;  //工商注册手机号
      params.legalInfo.cardFrontUrl = this.form.idCardInfo.card1.url;  //身份证正面
      params.legalInfo.cardBackUrl = this.form.idCardInfo.card2.url;  //身份证反面
      // if (this.form.agreeList.length > 0) {
      //   params.agreeInfo = {};
      //   params.agreeInfo.agreeList = this.form.agreeList; //委托代征协议扫描件 fileName 文件名称   fileUrl 文件路径
      // }
      // if (this.form.appPicList.length > 0) {
      //   params.appInfo = {};
      //   params.appInfo.appPicList = this.form.appPicList;  //APP验证成功截图
      // }
      //处理数组   经营范围ID
      // if (this.form.business.length > 0) {
      //   let arr = [];
      //   let business = this.form.business;
      //   for (let key in business) {
      //     if (business[key].manageId && business[key].manageId.length > 0){
      //       arr.push(filterNull(business[key].manageId))
      //     }
      //   }
      //   params.baseInfo.manageId = filterNullArr(arr);  //经营范围ID
      // }
      return params;
    },
    //提交审核
    examineFun(){
      let params = this.getParamData();

      //判断修改
      if (this.$route.query.bizId) {
        params.entId = this.bizId;
      }
      getEntInfo(params).then(res => {
        if (res.success) {
          if (res.result) {
            this.id = res.result.entId;
            //相关弹层关闭
            this.pageStatus = false;
            // this.isDepositShow = false;
            // this.isBankShow = false;
          }
          //提交审核
          if (this.nodeType == 6) {
            getInfoSubVerify(this.bizId).then(res => {
              if (res.success) {
                //相关弹层关闭
                this.pageStatus = false;
                // this.isDepositShow = false;
                // this.isBankShow = false;
              } else {
                this.$message.warning(res.message);
              }
            })
          } else {
            this.pageStatus = false;
          }
        } else {
          if (res.code == 516){
            this.businessInfo.visible = true;
            this.businessInfo.message = res.message;
          }else{
            this.$message.warning(res.message);
          }
        }
      })
    },
    //-------------------------获取经营范围  start ↓------------------
    //添加经营范围
    addNatureBusiness() {
      //企业类型 1-个体工商户 2-有限公司 3-合伙企业 4-个人独资企业
      let num = this.form.registerType == 1 ? 3 : 10;
      if (this.newTreeDataModel.length >= num) {
        this.$message.warning('经营范围最多可添加至' + num + '个');
      } else {
        this.$refs.child.add();
      }

      // if (this.form.registerType == 4) {
      //   if (this.newTreeDataModel.length >= 10) {
      //     this.$message.warning('经营范围最多可添加至10个')
      //   } else {
      //     this.$refs.child.add();
      //   }
      // } else {
      //   if (this.newTreeDataModel.length >= 5) {
      //     this.$message.warning('经营范围最多可添加至5个')
      //   } else {
      //     this.$refs.child.add();
      //   }
      // }
    },
    //删除经营范围
    // deleteRateFun(index){
    //   this.form.business.splice(index, 1);
    // },
    async initEvnet() {
      this.JYFWProEvent('getDataForJYFWNew',1,4).then(res=>{
        this.masterDataSource = res
      })
      this.JYFWProEvent('getDataForJYFWNew',0,4).then(res=>{
        this.newTreeData=res
      })
    },
    async getDataEvent_(meritoFlag,level,id){
      return await this.JYFWProEvent('getDataForJYFWNew',meritoFlag,level,id)
    },
    JYFWProEvent(type, ...args) {
      return JYFWProEvent(type, this, ...args)
    },
    //获取经营范围  废弃
    async getBusinessScope(isEdit) {
      // const tempData = await lfh.get('newTreeData')
      // // console.log('获取经营范围 0===>',tempData);
      // if(tempData){
      //   this.newTreeData = tempData;
      //   return false
      // }
      const param = {
        meritoFlag: 1 //  1 主营  0 非主营
      }

      //主数据源
      getManageNature(param.meritoFlag ,isEdit==true?1:null).then(res=>{
        if (res.success) {
          let data = res.result;
          this.masterDataSource = data
          if(data && data.length>0){
            this.treeData2ObjData(data)
          }
        }
      })

      // param.meritoFlag = 0
      // param.meritoFlag
      getManageNature(null,isEdit==true?1:null).then(res => {
        if (res.success) {
          let data = res.result;
          this.newTreeData = data;
          // lfh.set('newTreeData', result, 0.007) // 10分钟
          this.treeData = data || [];
          if(data&&data.length>0){
            this.treeData2ObjData(data)
          }
        } else {
          this.$message.warning(res.message);
        }
      })
    },
    //经营类别
    handleProvinceChange(value, index) {
      this.getLastItem(this.treeData, value, 'id', index)
      this.$forceUpdate();
    },
    //-------------------------提示经营范围有误  start ↓------------------
    //经营范围弹层--返回修改
    backEdit(){
      this.businessInfo.visible = false;
    },
    //-------------------------发布链接  start ↓------------------
    //发布连接
    releaseLink() {
      this.visible = true;
    },
    handleOk() {
      this.visible = false;
    },
    //复制链接
    copyLink() {
      copyLinkContent(this.urlValue, this);
    },
    //获取渠道注册短链接
    getEntgetRegistMsg() {
      let params = {};
      params.serviceConfId = this.form.serviceConfId;  //企业服务模式
      params.registerType = this.form.registerType  //注册类型
      params.protocolType = this.form.protocolType  //合作模式
      getRegistMsg(params).then(res => {
        if (res.success) {
          if (res.result) {
            this.urlValue = res.result;
          }
        } else {
          this.$message.warning(res.message);
        }
      })
    },
    //-------------------------办理（银行开户）提示  start ↓------------------
    //是否办理银行开户
    accountBank(mold){
      this.form.bankFlag = mold;
      if (mold == 1){
        this.isDepositShow = true;
        this.isBankShow = false;
      }else{
        this.examineFun();
      }
    },
    //取消弹层
    handleCancel(){
      this.isBankShow = false;
    },
    //-------------------------提示身份证不一致  start ↓------------------
    //清除身份证信息
    SureVerifyIDCard(){
      // this.sfzConfig.upLoadCardListConfig = [
      //   { type: '1', tips: '身份证人像面', fileInfo: { name: '', url: '' } },
      //   { type: '1', tips: '身份证国徽面', fileInfo: { name: '', url: '' } }
      // ]
      this.sfzConfig.defaultFileList.card1 = {}
      this.sfzConfig.defaultFileList.card2 = {}
      this.isCardShow = false;
    },
    //-------------------------企业服务模式选择  start ↓------------------
    selectServiceModelEvent(){
      this.EnterpriseServiceModelConfig.visible = true
    },
    radioChange(item) {
      if(item){
        // this.winConfig.svModelName = item.svModelName
        // this.winConfig.serviceConfId = item.id
        // this.tempProcessData['part0'][0] = {svModelName:item.svModelName,serviceConfId:item.id}
        this.EnterpriseServiceModelConfig.data = item.formArr
        this.EnterpriseServiceModelConfig.formTitle = item.title
        this.EnterpriseServiceModelConfig.serviceConfId = item.serviceConfId
        this.EnterpriseServiceModelConfig.visible = false
      }
    },
    hideModalSM() {
      this.EnterpriseServiceModelConfig.visible = false
    },
    handleCancelSM(e) {
      // console.log('Clicked cancel button');
      this.EnterpriseServiceModelConfig.visible = false;
    },
    //-------------------------企业注册信息预览  start ↓------------------
    //预览注册信息
    generatePDF(){
      this.newForm = this.getParamData();

      let cardInfo = this.form.idCardInfo;
      if (cardInfo){
        if (cardInfo.card1.url && cardInfo.card2.url){
          this.enterprisePreview.cardList = [
            {url: cardInfo.card1.url,title: cardInfo.card1.name},
            {url: cardInfo.card2.url,title: cardInfo.card2.name}
          ];
        }else if (cardInfo.card2.url){
          this.enterprisePreview.cardList = [
            {url: cardInfo.card2.url,title: cardInfo.card2.name}
          ];
        }else if(cardInfo.card1.url){
          this.enterprisePreview.cardList = [
            {url: cardInfo.card1.url,title: cardInfo.card1.name}
          ];
        }else{
          this.enterprisePreview.cardList = [];
        }
      }

      this.$nextTick(()=>{
        this.enterprisePreview.visible = true;
      })
    },
    //关闭
    closeFileModal(){
      this.enterprisePreview.visible = false;
    },
    //-------------------------获取详情查询  start ↓------------------
    //获取详情查询
    getQueryDetail(id) {
      getEntDetailInfo(id).then(res => {
        if (res.success) {
          if (res.result) {
            let data = res.result;
            data.warnMsg &&  this.$warning({
              title: '审核意见',
              content: data.warnMsg,
            });
            let paramsNew = cloneObject(data);
            this.EnterpriseServiceModelConfig.channelId = data.baseInfo.channelId
            // 企业服务模式
            this.EnterpriseServiceModelConfig.serviceModelVo = data.serviceModelVo
            this.EnterpriseServiceModelConfig.serviceConfId = data.serviceModelVo.id

            this.setFormItem({...data.serviceModelVo, ...data.serviceModelVo.servicefeeList && data.serviceModelVo.servicefeeList[0]})
            this.form.legalInfo = data.legalInfo || { legalName: '', cardNumber: '', cardAddress: '', cardTerm: '' };
            this.form.legalInfo.age = getIdCardInfo(data.legalInfo.cardNumber,3);

            //法人身份证信息
            // this.sfzConfig.upLoadCardListConfig[0].fileInfo.url = data.legalInfo && data.legalInfo.cardFrontUrl || '';
            // this.sfzConfig.upLoadCardListConfig[1].fileInfo.url = data.legalInfo && data.legalInfo.cardBackUrl || '';
            if(data.legalInfo){
              this.sfzConfig.defaultFileList.card1 = {name:'',url:data.legalInfo.cardFrontUrl || ''};
              this.sfzConfig.defaultFileList.card2  ={name:'',url:data.legalInfo.cardBackUrl || ''};
            }

            this.form.standardCulture = data.legalInfo && data.legalInfo.standardCulture || '';
            this.form.politicsStatus = data.legalInfo && data.legalInfo.politicsStatus || '';
            this.form.email = data.legalInfo && data.legalInfo.email || '';
            this.form.businessPhone = data.legalInfo && data.legalInfo.businessPhone || '';
            this.form.legalPhone = data.legalInfo && data.legalInfo.legalPhone || '';
            this.form.organizationForm = data.baseInfo && data.baseInfo.organizationForm;
            // console.log('this.form.organizationForm=====>',this.form.organizationForm,data.baseInfo && data.baseInfo.organizationForm);
            this.form.registerType = data.baseInfo && data.baseInfo.registerType;

            this.form.serviceConfId = data.baseInfo && data.baseInfo.serviceConfId;

            this.form.areaPre = data.baseInfo.areaPre;
            this.form.mailUserAddress = data.baseInfo.mailUserAddress;
            this.form.mailUserName = data.baseInfo.mailUserName;
            this.form.mailUserPhone = data.baseInfo.mailUserPhone;
            // 合作模式
            this.form.protocolType = data.baseInfo.protocolType;
            //总包不展示协议上传
            if (this.form.protocolType == 1){
              this.totalPoints = false;
            }else{
              this.totalPoints = true;
            }

            //处理注册资金
            if (data.baseInfo && paramsNew.baseInfo.registerMoney){
              this.form.registerMoney = data.baseInfo && conversionManyElement(paramsNew.baseInfo.registerMoney);
            }else{
              this.form.registerMoney = null;
            }

            // this.form.entServiceModel = data.baseInfo.entServiceModel;  //月开票服务模式

            //银行开户
            // this.form.bankFlag = data.bankFlag;
            // let resStatus = judgeNull(this.form.bankFlag);
            // resStatus ? this.getServiceCharge(this.form.serviceConfId) : this.form.bankFlag == 1 ? this.form.openBankInfo = data.openBankInfo : '';   //获取服务费
            this.getEntgetRegistMsg();   //获取渠道注册短链接

            //企业名称

            for(var i = 1; i < 6; i++){
              this.form['entName'+i+'Short'] = data.baseInfo['entName'+i+'Short'] || '';
              this.form['labelOrgnameId'+i] = data.baseInfo['labelOrgnameId'+i];
            }
            //经营范围处理
            const tempArr = []
            data.baseInfo.manageId.forEach((item,index)=>{
              //数组转字符串格式  organizationForm
              let temp=''
              if(index==0){
                temp = data.baseInfo.organizationForm
              }
              tempArr.push({ids: [...Array.from(item).map(String)],organizationForm:temp})
            })
            this.newTreeDatadefaultModel = tempArr
            // console.log('设置默认值=================>',tempArr);

            // const tempArr = []
            // data.baseInfo.manageId && data.baseInfo.manageId.forEach((item,index)=>{
            //   const itemInfo = this.treeData_[item[1]]
            //   const tempItem = {
            //     manageId: [...Array.from(item).map(String)],
            //     nodeNature: '',
            //     invoiceName: '',
            //     labelEntname: '',
            //     labelOrgname: '',
            //   }
            //   tempItem.nodeNature = itemInfo.nodeNature;
            //   tempItem.invoiceName = itemInfo.invoiceName;
            //   tempItem.labelEntname = itemInfo.labelEntname;
            //   tempItem.labelOrgname = itemInfo.labelOrgname;
            //   tempArr.push(tempItem)
            // })

            ////处理上传文件
            //合同附件信息
            if (data.agreeInfo && data.agreeInfo.agreeList && data.agreeInfo.agreeList.length > 0) {
              this.form.agreeElec = data.agreeInfo.agreeElec; //agreeElec  电子签是否完成 0-否 1-是
              this.form.agreeType = data.agreeInfo.agreeType; //agreeElec  合同类型 0-无 1：电子版；2:纸质版 （默认1)
              this.form.agreeList = data.agreeInfo.agreeList;
              this.signConfig.defaultFileList.card1 = {url:data.agreeInfo && data.agreeInfo.agreeList[0] && data.agreeInfo.agreeList[0].fileUrl || '',name:''};
            }
            //APP截图信息
            // if (data.appInfo && data.appInfo.appPicList && data.appInfo.appPicList.length > 0) {
            //   this.form.appPicList = data.appInfo.appPicList;
            //   this.sfrzConfig.defaultFileList.card1 = {url:data.appInfo && data.appInfo.appPicList[0] && data.appInfo.appPicList[0].fileUrl || '',name:''};
            // }


            if(!this.$IS.isNullOrUnDef(data.businessAccountResp)&& !this.$IS.isNullOrUnDef(data.businessAccountResp.bankName)){
              this.caiConfig.value.bankName = data.businessAccountResp.bankName
              this.caiConfig.value.accNo = data.businessAccountResp.bankAccountNo
            }
            const tenpObj  = {entTaxPic:{}, entHirePic:{}}
            if(this.$IS.isArray(data.entTaxPic.entTaxPicList)&& !this.$IS.isEmpty(data.entTaxPic.entTaxPicList)){
              tenpObj['entTaxPic'] = {url:'',name:''}
              tenpObj.entTaxPic.name = data.entTaxPic.entTaxPicList[0].fileName
              tenpObj.entTaxPic.url =data.entTaxPic.entTaxPicList[0].fileUrl
            }
            if(this.$IS.isArray(data.entHirePic.entHirePicList)&& !this.$IS.isEmpty(data.entHirePic.entHirePicList)){
              tenpObj['entHirePic'] = {url:'',name:''}
              tenpObj.entHirePic.name = data.entHirePic.entHirePicList[0].fileName
              tenpObj.entHirePic.url =data.entHirePic.entHirePicList[0].fileUrl
            }
            this.qoriConfig.defaultList =tenpObj
          }
        } else {
          this.$message.warning(res.message);
        }
      })
    },
    //-------------------------获取渠道信息 && 服务费  start ↓------------------
    //获取渠道信息
    getChannelUserInfo() {
      queryLoginChannel().then(res => {
        if (res.success) {
          let data = res.result;
          // protocolType 委托代征协议类型： 1总包；2分包
          if (data.agreeInfoVo) {
            //“总包”协议用户，不展示企业《委托代征协议》
            if (data.agreeInfoVo.protocolType == 1) {
              this.totalPoints = false;
            } else {
              this.totalPoints = true;
            }
          }
        } else {
          this.$message.warning(res.message);
        }
      })
    },
    //获取服务费
    getServiceCharge(serviceConfId){
      // let serviceConfId = this.form.serviceConfId;
      queryServicePrice(serviceConfId).then(res => {
        if (res.success){
          if (res.result){
            this.serviceMoney = conversionElement(res.result.svBankPrice);
          }
        }else{
          this.$message.warning(res.message);
        }
      })
    },
    //------------------------- 封装方法  start ↓ ---------------------
    //重构数据
    recombFun(list){
      var obj={};
      list.map(function(e){
        obj[e.id] = {'value':e.value,'id':e.id };
      })
      return obj;
    },
    //查询是否存在
    containsFun(arr, val) {
      if(arr && arr.length>0 && val && val.length>0){
        for (var i = 0; i < arr.length; i++) {
          if (arr[i] == val) {
            return true;
          }
        }
        return false;
      }else{
        return false;
      }

    },
    // 获取点击得目标对象, key 对应得 值vals 数组（重点部分）
    getLastItem(list, vals, key, indexd) {
      let LIST = list || []
      for (let item of LIST) {
        if (item[key] === vals[vals.length - 1]) {
          //获取当前选中id值对应的对象
          this.form.business[indexd].nodeNature = item.nodeNature;
          this.form.business[indexd].invoiceName = item.invoiceName;
          this.form.business[indexd].labelEntname = item.labelEntname;
          this.form.business[indexd].labelOrgname = item.labelOrgname;

          return ;
        } else {
          this.getLastItem(item.children, vals, key, indexd)
        }
      }
    },
    /**
     * 将属性结构的数据扁平化
     * */
    treeData2ObjData(treeData){
      const getData = (treeData_)=>{
        treeData_.forEach(item=>{
          const {children,id} = item
          this.treeData_[id] = item
          if(this.isType.isArray(children) && children.length>0){
            getData(children)
          }
        })
      }
      getData(treeData)
    },
    setFormItem(itemValueList){
      const temp = [...this.EnterpriseServiceModelConfig.data]
      temp.forEach((dataItem, i) => {
        const { enName } = dataItem
        // console.log('0000000000',enName, itemValueList[enName],itemValueList);
        if (enName.indexOf('|') >= 0) {
          const t = enName.split('|')
          temp[i]['value'] = conversionElement(itemValueList[t[0]]) + this.EnterpriseServiceModelConfig.unit +' ≤ ' + conversionElement(itemValueList[t[1]]) +this.EnterpriseServiceModelConfig.unit
          // console.log(enName,t,tempObj_[t[0]] + '' + tempObj_[t[1]],tempObj_);
        } else {
          if (enName === 'servicerateList') {
            temp[i]['value'] = this.dataConv(enName, { d: itemValueList[enName], rateType: itemValueList['rateType'] })
          } else {
            temp[i]['value'] = this.dataConv(enName, itemValueList[enName])
          }
          // console.log(enName,tempObj_[enName],item);

          //企业注销费
          if (enName === 'svCanclePrice') {
            let valueNew = itemValueList[enName];
            temp[i]['value'] = valueNew > 0 ? this.dataConv(enName, valueNew) + '起' : '0元'
          }
        }
      })
      this.EnterpriseServiceModelConfig.data = temp
    },
    dataConv(enName, value) {
      const ll = ['svRegistPrice', 'svBankPrice', 'svTaxPrice', 'politicsStatus', 'svYearPrice', 'svCanclePrice','svBusinessPrice']
      let res = ''
      // console.log('@@@@@@@@@@@@@@@@@@@@@@@@@',enName, value);
      if (ll.indexOf(enName) >= 0) {
        res = conversionElement(value)
        // console.log('111111111111',enName,value,res);
        if (isNaN(res)) {
          res = '--'
        }
        res += this.EnterpriseServiceModelConfig.unit
      } else {
        res = value
      }
      // console.log('dataConv===>',enName,value,res + '元');
      return res

    },
    //-------------------------校验规则  start ↓ ---------------------
    // 校验 经营类别
    validateManageId(rule, value, callback) {
      const tempArr = this.form.business
      if (tempArr.length == 0) {
        callback("请选择经营类别！");
        return false
      }
      let isPass = true
      tempArr.forEach(item => {
        const { manageId } = item
        if (manageId && manageId.length <= 0) {
          isPass = false
        }
      })
      // console.log('validateManageId===>', rule, value, tempArr, isPass);
      if (!isPass) {
        callback("请选择经营类别！");
      } else {
        callback();
      }
    },
    // 身份证校验
    validateIdCardInfo(rule, value, callback) {
      this.$nextTick(()=>{
        // console.log('身份证校验  validateIdCardInfo====>', value, this.form.idCardInfo);
        if(value.card1 ){
          const { card1, card2 } = this.form.idCardInfo
          if (!card1.url || card1.url == '') {
            callback("请上传法人身份证正面图片！");
            return false
          }
          if (!card2.url || card2.url == '') {
            callback("请上传法人身份证反面图片！");
            return false
          }
          callback();

        }else{
          // callback("请上传法人身份证图片！");
        }
      })
      // callback();
    },
    //企业名称判断规则展示
    tsEntNameReg(name) {
      //企业类型 1-个体工商户 2-有限公司 3-合伙企业 4-个人独资企业
      if (this.form.registerType == 1) {
        //判断经营类别是否选择
        // if (this.form.business[0].invoiceName) {
        if (this.form.business.length > 0) {

        } else {
          this.$message.warning('请选择经营类别');
        }
      }
    },
    // 校验手机号
    validatePhone(rule, value, callback) {
      let reg = /^(1\d{10})$/;
      if (!value || reg.test(value)) {
        this.verifyMobile(value); //校验手机号是否重复注册
        callback();
      } else {
        callback("您的手机号码格式不正确!");
      }
    },
    validatePhone1(rule, value, callback) {
      let reg = /^(1\d{10})$/;
      if (!value || reg.test(value)) {
        callback();
      } else {
        callback("您的手机号码格式不正确!");
      }
    },
    //校验邮箱
    validateEmail(rule, value, callback) {
      let reg = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/;
      if (!value || reg.test(value)) {
        callback();
      } else {
        callback("您的邮箱格式不正确!");
      }
    },
    //验证企业名称
    validateEntName(rule, value, callback) {
      let reg = /^[\u4e00-\u9fa5]{2,}$/gi;
      if (!value || reg.test(value)) {
        this.tsEntNameReg(value);
        callback();
      } else {
        callback("您的企业名称格式不正确!");
      }
    },
    //限制两位小数
    limitTwoDigits(value) {
      return limitDigits(value)
    },
    // methods 正则替换小数点
    limitNumber(value) {
      if (typeof value === 'string') {
        return !isNaN(Number(value)) ? value.replace(/\./g, '') : 0
      } else if (typeof value === 'number') {
        return !isNaN(value) ? String(value).replace(/\./g, '') : 0
      } else {
        return 0
      }
    },
  }
}
</script>

<style scoped lang="less">
.main_content {
  color: @color-smudge;
}

h5 {
  text-align: center;
  font-size: 16px;
  color: @color-red;

  button {
    margin: 0 10px;
  }
}

h3 {
  font-weight: bolder;
}

//
h4 {
  font-weight: bolder;
}


.largePreview{
  width: 276px;
  height: 44px;
}
.btnsLine{
  border: 1px solid #4266E5;
  color: #4266E5;
}


.avoid {
  background: @color-red;
  color: #FFFFFF;
  display: inline-block;
  width: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 14px;
  border-radius: 50%;
}

.quota {
  max-width: 400px;
  border: 1px solid #d9d9d9;

  p {
    border-bottom: 1px solid #d9d9d9;
    display: flex;
    justify-content: space-between;
    //padding: 0 15px;
    line-height: 30px;
    margin-bottom: 0;

    span {
      flex: 2;
      display: inline-block;
      text-align: center;
    }

    span:nth-child(1) {
      flex: 1;
      border-right: 1px solid #d9d9d9;
    }
  }

  p:nth-child(3) {
    border-bottom: none;
  }
}

.charge {
  color: @color-red;
  font-weight: bolder;
}

.cardUpload {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.detail-img-style {
  width: 334px;
  height: 224px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #ccc;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
  padding: 26px;
}

.operation input {
  margin-bottom: 15px;
}

.selection {
  display: flex;
  justify-content: space-between;
}

.selection .ant-select {
  width: 45%;
}

.addRange {
  cursor: pointer;
  color: @color-orange;
}


/deep/.ant-descriptions-item-content {
  width: 100% !important;
}

/deep/.ant-descriptions-item{
  padding: 16px 0 !important;
  display: inline-flex !important;
  align-items: flex-start !important;
  width: 80% !important;
}
.commonItem{
  white-space: nowrap;
  margin-right: 10px;
  //width: 100px;
  display: inline-block;
  text-align: right;
}




.entNames {
  display: flex;
  align-items: center;
  white-space: nowrap;

  .ant-form-item {
    margin: 0 5px;
    flex: 1;
  }
}



/deep/.ant-descriptions-title {
  font-size: 14px;
}

//alert提示
/deep/.ant-alert-info {
  background: #F3F6FD;
  border-radius: 2px;
  border: 1px solid @color-blue;
}

/deep/.ant-alert-message {
  color: #777777;
  font-size: 14px;
}

//成功展示调整
/deep/.ant-result-title {
  font-weight: bolder;
}

/deep/.ant-result-success .ant-result-icon>.anticon {
  color: @color-blue;
}

.minus{
  position: absolute;
}


/deep/.ant-modal-content .ant-modal-header{
 border: none;
}
/deep/.ant-modal-content .ant-modal-header .ant-modal-title{
  justify-content: center;
}
/deep/.ant-modal-body{
  color: @color-smudge;
  letter-spacing: 1px;
  line-height: 25px;
  font-size: 16px;
}




//提示经营范围有误弹层
.exceedLimit{
  width: 100%;
  padding: 20px 10px;
  color: #101010;
  h4{
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bolder;
    font-size: 20px;
    margin-left: -20px;
    margin-bottom: 20px;
    i{
      color: @color-red;
      font-size: 50px;
      margin-right: 10px;
    }
  }
  .desc_btn{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin: 40px 0 20px 0;
    text-align: center;
  }
}
</style>
<style lang="less">
 .esm-item {
      margin: 10px 0;

      .card-title {
        font-size: 16px;
        font-family: PingFangSC-Semibold, PingFang SC;
        font-weight: 600;
        color: #333333;
        display: flex;
        justify-content: space-between;
        align-items: center;

        .ant-radio-button-wrapper:last-child {
          border-radius: 4px;
          border: 1px solid #d9d9d9;
        }

        .ant-radio-button-wrapper:not(:first-child)::before {
          width: 0px;
        }

        .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled) {
          border-color: #022EA0;
        }
      }

      .esm-item-body {
        padding: 10px;
        width: 100%;


        .pf-con {
          .ant-form {
            .ant-row {
              .ant-col {
                .ant-form-item {
                  margin-bottom: 5px;
                }
              }
            }
          }
        }

      }
    }
</style>
